refactor(data-plane): drop the counter-delta branch a selected program never takes - #784
Merged
Merged
Conversation
…m never takes RawDagProgram::uses_counter_delta returned a constant `false`, with a comment explaining why: Planner represents rate as an explicit upstream operator, so a sample reaches the accumulator unchanged. Three call sites still branched on it, and the counter-delta side of each was unreachable whenever a program was present. In worker.rs the two sites asked the program and were always told no, so the condition is just the legacy configured update rule, which only applies when there is no program. Name that: `legacy_counter_delta`. In window_builder.rs the program is a required parameter, so the branch was dead outright. Its `previous` map existed only to feed `reset_aware_counter_delta` and goes with it; each sample is now applied as it arrives. Behaviour is unchanged: every removed path was already unreachable. `cargo test -p data_plane --lib` 934 passed, `-p control_plane --lib` 433 passed, clippy with `-D warnings` clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RawDagProgram::uses_counter_deltareturned a constantfalse:Three call sites still branched on it, so the counter-delta side was unreachable whenever a program was present.
worker.rs:549program.map_or_else(legacy_rule, |p| p.uses_counter_delta())legacy_counter_delta(state)— the legacy rule only applies with no programworker.rs:609window_builder.rs:172if program.uses_counter_delta() { reset_aware_counter_delta(...) } else { Some(value) }programis a required parameter there, so the branch was dead outrightThe
previousmap inwindow_builder.rsexisted only to feedreset_aware_counter_deltaand goes with it.Behaviour
Unchanged. Every removed path was already unreachable, which is why this is a deletion rather than a rewrite.
cargo test -p data_plane --lib934 passed,cargo test -p control_plane --lib433 passed,cargo fmt --checkandcargo clippy --all-targetswith-D warningsclean.Context
Found while checking, after #774, which backend abstractions the shared
asap-physical-operatorscrate had made redundant.RawDagProgramitself is not redundant: it already delegates accumulation toasap_physical_operators::factory, and what remains is the backend's own binding glue. This constant method was the one genuinely dead piece.🤖 Generated with Claude Code